Skip to content

Conversation

@callicles
Copy link
Collaborator

@callicles callicles commented Nov 28, 2025

Note

Adds end-to-end support for accepting arbitrary JSON fields in IngestApi/Stream (TS index signatures, Python extra='allow') and passing them through to streaming functions, with validation, infra wiring, tests, and docs.

  • Ingestion pipeline: arbitrary fields support
    • TS: Allow index signatures for IngestApi, Stream, and IngestPipeline (when table=false); inject allowExtraFields through TypedBase, Stream, IngestApi, and IngestPipeline.
    • PY: Treat dict[str, Any] and Any as JSON; detect Pydantic extra='allow' and emit allow_extra_fields in infra map.
    • Infra/Rust: Add allow_extra_fields to DataModel and ingest API wiring; enhance DataModelVisitor with pass-through for extra fields using streaming PassThroughSeed; route to Kafka unchanged.
    • Infra map: Carry allow_extra_fields from partial -> full map for ingress APIs.
  • Compiler/validation
    • TS compiler plugin: toColumns option to allow index signatures; block IngestPipeline with table+index signatures; propagate flag into constructors.
  • Tests & e2e
    • Add TS unit tests for index signature validation and extensive e2e tests (TS/PY) verifying extra fields pass to transforms and persist in UserEventOutput.properties.
    • Update expected schemas to include local.UserEventOutput (TS/PY variants).
  • Docs
    • Document accepting arbitrary fields for TS (index signatures) and PY (extra='allow'), with transform examples.

Written by Cursor Bugbot for commit 40393f0. This will update automatically on new commits. Configure here.

@linear
Copy link

linear bot commented Nov 28, 2025

@vercel
Copy link

vercel bot commented Nov 28, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docs-v2 Ready Ready Preview Comment Dec 5, 2025 3:03am
framework-docs Ready Ready Preview Comment Dec 5, 2025 3:03am

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enables IngestApi and Stream resources to accept payloads with arbitrary additional fields beyond their defined schema using TypeScript index signatures and Python's extra='allow' configuration. The API validates known fields while gracefully accepting extra fields without validation errors.

Key Changes:

  • Modified the TypeScript compiler to allow index signatures for IngestApi and Stream types while extracting only named properties as columns
  • Added comprehensive test coverage including templates, transforms, and E2E tests
  • Updated documentation for both TypeScript and Python implementations

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/ts-moose-lib/src/dataModels/typeConvert.ts Added ToColumnsOptions interface with allowIndexSignatures flag to conditionally permit index signatures
packages/ts-moose-lib/src/dmv2/dataModelMetadata.ts Enabled allowIndexSignatures for IngestApi and Stream resource types
templates/typescript-tests/src/ingest/indexSignatureTests.ts Created test types and resources demonstrating index signature usage with IngestApi
templates/typescript-tests/src/ingest/transforms.ts Added transform mapping UserEventInput to UserEventOutput with logging
apps/framework-cli-e2e/test/utils/schema-definitions.ts Added expected schema for UserEventOutput table
apps/framework-cli-e2e/test/templates.test.ts Added E2E test validating ingestion and transform of payloads with extra fields
apps/framework-docs/src/pages/moose/apis/ingest-api.mdx Added "Accepting Arbitrary Fields" documentation section
apps/framework-docs-v2/content/moosestack/apis/ingest-api.mdx Added "Accepting Arbitrary Fields" documentation section
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

@callicles callicles requested a review from a team November 28, 2025 18:28
@callicles callicles added this pull request to the merge queue Dec 5, 2025
Merged via the queue into main with commit 11a7984 Dec 5, 2025
56 checks passed
@callicles callicles deleted the nico/eng-1617-support-index-signatures-in-ingestapi-data-models branch December 5, 2025 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants